#
# $Header: mkinitramfs-ll/hooks/bacache                  Exp $
# $Author: (c) 2011-6 tokiclover <tokiclover@gmail.com>  Exp $
# $License: 2-clause/new/simplified BSD                  Exp $
# $Version: 0.22.1 2019/01/02 12:33:03                   Exp $
#

[ -z "$bcache" ] && get_cmdline_option "bcache"

undobcahe() {
	echo $$ >/run/${0##*/}.pid
	local IFS=":$IFS" _dev _DEV

	for _dev in $bcache; do
		blk "$_dev" "_DEV"
		_dev=${_DEV##*/}
		echo 1 > /sys/block/${_dev:0:3}/$_dev/bcache/running
	done
	rm -f /run/${0##*/}.pid
}

[ -n "$bcache" ] && undobcache

#
# vim:fenc=utf-8:ft=sh:ci:pi:sts=0:sw=4:ts=4:
#
